<?php
@session_start();
require_once("connect_db.php");

$sqlGen="SELECT order_id FROM orders ORDER BY order_id DESC LIMIT 1";
$queryGen=mysql_query($sqlGen,$conn);
$resultGen=mysql_fetch_array($queryGen);
$number =(int)substr($resultGen["order_id"],1);
$id="o".str_pad(($number+1),7,"0",STR_PAD_LEFT );
$sqlRegister="INSERT INTO orders(order_id,order_date_regis,course_id,std_id,teach_id";
$sqlRegister.=",order_status) VALUES(";
$sqlRegister.="'".$id."','".date("Y-m-d")."','".$_GET["temp"]."','".$_SESSION["id"]."'";
$sqlRegister.=",'".$_GET["teach"]."'";
$sqlRegister.=",'W')";
$queryRegister=mysql_query($sqlRegister,$conn);


?>